fix(setup): replace dead executor PATH probe with importability check - #487
Open
ProtocolWarden wants to merge 2 commits into
Open
fix(setup): replace dead executor PATH probe with importability check#487ProtocolWarden wants to merge 2 commits into
ProtocolWarden wants to merge 2 commits into
Conversation
`ensure_executor_installed("team-executor")` + `verify_executor` gated
interactive setup on a console script that TeamExecutor never produces
(no `[project.scripts]`), so the wizard hard-failed at that step on every
run — after burning a `uv tool install` network fetch. Verified against
the live stack: `shutil.which("team-executor")` is None.
The probe measured the wrong thing. OC consumes all three execute
backends as LIBRARIES — backends/{team,dag,critique}_executor/adapter.py
each do a plain `import <module>` — so importability in OC's venv is the
only readiness signal that means anything. PATH is not: TeamExecutor and
CritiqueExecutor ship no console script at all, and the one that exists
(DAGExecutor's `dag-executor`) is never invoked by OC.
Replaced with `missing_executor_backends()` + `ensure_executor_backends_
installed()`, mirroring `ensure_executor_backends()` in
scripts/operations-center.sh: probe each backend with
`<venv-python> -c "import <module>"`, install missing ones editable from
their sibling checkouts, re-probe. Probing in a subprocess (not
importlib in-process) keeps a mid-run install visible to the re-check.
Config keys:
* `team_executor.binary` — removed. No writer (render_settings_yaml never
emitted it), no settings field (TeamExecutorSettings has no `binary`),
no reader outside setup's own prompt default.
* `OPERATIONS_CENTER_EXECUTOR_INSTALL_REF` — kept, repurposed. It has a
live consumer in dependency_check.py, but its old meaning ("git ref to
install from") died with ensure_executor_installed. Relabeled as a
drift-reporting version pin, which is what that consumer already did
with it.
Same stale-CLI bug had a second instance: collect_dependency_statuses
probed `team-executor --version`, so the TeamExecutor row reported
healthy=False / "not installed or not on PATH" on every run, forever.
Now uses `executor_backend_status()` (importability + best-effort
distribution version); `kind` corrected "cli" -> "library".
Setup covers all three backends; the shell self-heal still covers only
two — a dropped CritiqueExecutor is not yet auto-repaired at fleet
launch. Left alone deliberately (fleet-startup behavior, outside this
change's blast radius); tracked in .console/backlog.md under Up Next.
Verified against the live venv: missing_executor_backends() -> [], all
three backends report (True, '0.1.0'). 10 new tests; full suite 10354
passed with the same 6 pre-existing sandbox/timing failures, all
reproduced on an unmodified checkout.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
ensure_executor_installed("team-executor")+verify_executor()insrc/operations_center/entrypoints/setup/main.pygated the interactive setup wizard on a step that could never pass:check_command_installed("team-executor")uv tool install git+https://github.com/ProtocolWarden/TeamExecutor.git@dev --forcetyper.BadParameter("[executor] ERROR: installation failed")verify_executor→team-executor --helpTeamExecutor declares no
[project.scripts], so noteam-executorconsole script is ever produced. Verified against the live stack:shutil.which("team-executor")isNone. Every setup run hard-failed at that gate — after burning auv tool installnetwork fetch first.Why the probe was measuring the wrong thing
OC consumes all three execute backends as libraries —
backends/{team_executor,dag_executor,critique_executor}/adapter.pyeach do a plainimport <module>. So importability in OC's venv is the only readiness signal that means anything.PATH is not: TeamExecutor and CritiqueExecutor ship no console script at all, and the one that does exist (DAGExecutor's
dag-executor) is never invoked by OC.The fix
missing_executor_backends()+ensure_executor_backends_installed(), mirroring theensure_executor_backends()self-heal inscripts/operations-center.sh:<venv-python> -c "import <module>"uvonly if a backend is actually missing../TeamExecutor,../DAGExecutor,../CritiqueExecutor)The probe runs in a subprocess rather than via
importlibin-process, so an install that lands partway through setup is visible to the re-check (the parent's import caches would still answer for the pre-install state).Config-key decisions
team_executor.binaryTeamExecutorSettingshas nobinaryfield,render_settings_yamlnever wrote the key, and the only reader was setup's own prompt default.OPERATIONS_CENTER_EXECUTOR_INSTALL_REFmaintenance/dependency_check.py), but its old meaning ("git ref to install from") died withensure_executor_installed. Relabeled as a version pin for drift reporting — which is what dependency-check already did with it, and how the docs already grouped it alongside the Plane and provider CLI pins.Second instance of the same bug
collect_dependency_statusesprobedteam-executor --version, so the TeamExecutor row reportedhealthy=False/ "not installed or not on PATH" on every single run, forever. Replaced withexecutor_backend_status()(importability + best-effort distribution version viapackages_distributions());kindcorrected"cli"→"library".Known gap, deliberately not closed here
ensure_executor_backends()inscripts/operations-center.shprobes onlyimport team_executor, dag_executorand reinstalls only two siblings.critique_executoris a third backend OC loads, so auv sync/venv-recreate that drops it is not auto-repaired at fleet launch. Setup now covers all three; the launcher is the remaining gap.Left alone deliberately — that's fleet-startup behavior, outside this change's blast radius. Tracked in
.console/backlog.mdunder "Up Next".Verification
Probed the live venv:
test_setup_cli.py, 3 intest_dependency_check.py); 26 pass across the two touched filesruff check/ruff format --checkclean.console/backlog.mdfrom prior stages, each reproduced on an unmodified checkoutcustodian-multiagainst this worktree: 0 findingsDocs
docs/operator/setup.md— rewrote "Executor Install Behavior" (it described the broken flow as if it worked), fixed the "install/verifyteam-executorCLI" bullet and the Advanced Mode pin descriptiondocs/demo.md— corrected the prerequisite telling operators to putteam-executoron PATH🤖 Generated with Claude Code